package com.bdqn.sz.aopjdk;
import org.apache.log4j.Logger;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class AopjdkLogg implements InvocationHandler {
    private Logger logger = Logger.getLogger(AopjdkLogg.class);
    private Object target;
    public void setTarget(Object target)  {
        this.target = target;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws InvocationTargetException, IllegalAccessException {
        logger.debug("开始");
        // 调用目标对象上的方法
        Object result = method.invoke(target, args);
       logger.debug("结束");
        return result;
    }
}
